home *** CD-ROM | disk | FTP | other *** search
- #! /bin/sh
- : &&O= || exec /bin/sh $0 $argv:q # we're in a csh, feed myself to sh
- #{{{ get mode
- mode="755"
- if test x$1 = x-m
- then
- shift
- mode=$1
- shift
- fi
- #}}}
- #{{{ get list of needed dirs
- dir_list=""
- file=$1
- while test 1
- do
- #{{{ break on .
- if test $file = "."
- then
- break
- fi
- #}}}
- #{{{ break on /
- if test $file = "/"
- then
- break
- fi
- #}}}
- dir_list="$file $dir_list"
- file=`dirname $file`
- done
- #}}}
- #{{{ mk all needed dirs
- for i in $dir_list
- do
- if test -d $i
- then
- :
- else
- mkdir $i
- chmod $mode $i
- fi
- done
- #}}}
-